package com.wedata.wegymer;

import cn.hutool.crypto.digest.MD5;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.wedata.HttpUtils;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class 结算门店变更BUG {

    public static void main(String[] args) throws IOException {

        FileReader fileReader = new FileReader("src\\main\\java\\com\\wedata\\结算门店变更BUG.txt");
        BufferedReader br = new BufferedReader(fileReader);
        String line = br.readLine();
        Map<Integer,String> map = new HashMap<>();
        for(;line!=null;line = br.readLine()){
            JSONObject jsonObject = new JSONObject(line);
            if(jsonObject.getInt("code")==500){

                String uri = "https://wedata.gymcity.com.cn/openapi/finance/card/pay/notifySettleShopChange";
                JSONArray jsonArray = jsonObject.getJSONArray("requestBody");
                //System.out.println(jsonArray.getJSONObject(0).get("cardId"));

                String sign = MD5.create().digestHex(jsonArray+"#a5bc45af0b6c3c8a971b83812e35af0c");
                JSONObject header = new JSONObject("{\"X-TRACEID\":\"uuid\",\"X-APPKEY\":\"87075547368\",\"X-SIGN\":\""+sign+"\"}");

                Long s = System.currentTimeMillis();
                System.out.println(HttpUtils.sendPost(uri,header,jsonArray)+":"+(System.currentTimeMillis()-s) + jsonArray);
            }

        }
        br.close();
        fileReader.close();


        /*
{"code":200,"msg":"操作成功","data":null,"time":1704364464}:554[{"cardId":199497,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364464}:114[{"cardId":198689,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364464}:102[{"cardId":198688,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364464}:111[{"cardId":198155,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364464}:100[{"cardId":198137,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364464}:118[{"cardId":196873,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364465}:118[{"cardId":193461,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364465}:118[{"cardId":192330,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364465}:124[{"cardId":191454,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364465}:120[{"cardId":191066,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364465}:124[{"cardId":190396,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364465}:110[{"cardId":190361,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364465}:122[{"cardId":187366,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364465}:122[{"cardId":186173,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364466}:103[{"cardId":186158,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364466}:106[{"cardId":186139,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364466}:119[{"cardId":185812,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364466}:127[{"cardId":181795,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364466}:139[{"cardId":172289,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364466}:137[{"cardId":171736,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364466}:134[{"cardId":171462,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364466}:104[{"cardId":171460,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364467}:135[{"cardId":171093,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364467}:132[{"cardId":170775,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364467}:136[{"cardId":169531,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364467}:134[{"cardId":169201,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364467}:134[{"cardId":168482,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364467}:120[{"cardId":168305,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364467}:192[{"cardId":152398,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364468}:157[{"cardId":152176,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364468}:165[{"cardId":150151,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364468}:110[{"cardId":150144,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364468}:153[{"cardId":149904,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364468}:120[{"cardId":149903,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364468}:160[{"cardId":149617,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364468}:129[{"cardId":149569,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364469}:130[{"cardId":149399,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364469}:162[{"cardId":148709,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364469}:153[{"cardId":148542,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364469}:161[{"cardId":148141,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364469}:162[{"cardId":147698,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364469}:159[{"cardId":147296,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364469}:175[{"cardId":146892,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364470}:158[{"cardId":146538,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364470}:159[{"cardId":145748,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364470}:181[{"cardId":117242,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364470}:159[{"cardId":115619,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364470}:167[{"cardId":102991,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364471}:184[{"cardId":99914,"effectDate":"2023-12-17","newShopId":231}]
{"code":200,"msg":"操作成功","data":null,"time":1704364471}:110[{"cardId":199476,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364471}:98[{"cardId":198733,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364471}:110[{"cardId":198328,"effectDate":"2023-12-04","newShopId":214}]
{"code":200,"msg":"操作成功","data":null,"time":1704364471}:114[{"cardId":195818,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364471}:122[{"cardId":168612,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364471}:108[{"cardId":197945,"effectDate":"2023-12-04","newShopId":214}]
{"code":200,"msg":"操作成功","data":null,"time":1704364471}:102[{"cardId":197894,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364471}:115[{"cardId":193021,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364471}:101[{"cardId":192946,"effectDate":"2023-12-04","newShopId":201}]
{"code":200,"msg":"操作成功","data":null,"time":1704364472}:102[{"cardId":191529,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364472}:116[{"cardId":189797,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364472}:117[{"cardId":189477,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364472}:130[{"cardId":175338,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364472}:117[{"cardId":185343,"effectDate":"2023-12-04","newShopId":201}]
{"code":200,"msg":"操作成功","data":null,"time":1704364472}:107[{"cardId":185157,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364472}:115[{"cardId":182295,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364472}:121[{"cardId":180549,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364473}:108[{"cardId":175434,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364473}:163[{"cardId":151687,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364473}:106[{"cardId":175336,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364473}:122[{"cardId":174992,"effectDate":"2023-12-04","newShopId":201}]
{"code":200,"msg":"操作成功","data":null,"time":1704364473}:116[{"cardId":179054,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364473}:115[{"cardId":171207,"effectDate":"2023-12-04","newShopId":201}]
{"code":200,"msg":"操作成功","data":null,"time":1704364473}:126[{"cardId":168800,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364473}:102[{"cardId":168321,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364474}:128[{"cardId":168036,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364474}:135[{"cardId":167600,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364474}:131[{"cardId":166894,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364474}:139[{"cardId":161638,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364474}:157[{"cardId":150894,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364474}:159[{"cardId":144771,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364474}:161[{"cardId":135059,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364475}:196[{"cardId":128574,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364475}:120[{"cardId":128552,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364475}:179[{"cardId":126319,"effectDate":"2023-12-04","newShopId":229}]
{"code":200,"msg":"操作成功","data":null,"time":1704364475}:155[{"cardId":38172,"effectDate":"2023-12-04","newShopId":229}]

*/

    }


}



